/**
 * 
 */
package aiproject3.util;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;
import java.util.Random;

/**
 * @author Chris
 *
 */
public class TestFileHelper {

	public static void CreateTestFile(String path, int length) {
		File file = new File(path);
		if (!file.exists() && length > 0) {
			try {
				Random rand = new Random(new Date().getTime());
				FileWriter fw = new FileWriter(file);
				fw.write((int)('A' + rand.nextInt(26)));
				for (int i = 1; i < length; i++) {
					fw.write(',');
					fw.write((int)('A' + rand.nextInt(26)));					
				}
				fw.close();
			} catch (IOException ex) {
				System.out.println("Error: Unable to create new test file... \n" + ex.getMessage());
			}
			
		}
	}
	
}
